package cn.tannn.surenessdemo.sureness.processor;

import com.usthe.sureness.provider.SurenessAccount;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 用户信息 存redis的 用默认的SurenessAccount报了错
 * @author tomsun28
 * @date 16:20 2019-05-19
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RedisAccount implements SurenessAccount {


    /** 用户唯一编码 **/
    private String appId;

    /** 用户密码 **/
    private String password;

    /** 盐 **/
    private String salt;

    /** 权限集合 **/
    private List<String> ownRoles;

    /** 是否被禁用 **/
    private boolean disabledAccount;

    /** 是否被锁定 **/
    private boolean excessiveAttempts;


    @Override
    public String getAppId() {
        return this.appId;
    }

    @Override
    public String getPassword() {
        return this.password;
    }

    @Override
    public String getSalt() {
        return this.salt;
    }

    @Override
    public List<String> getOwnRoles() {
        return this.ownRoles;
    }

    @Override
    public boolean isDisabledAccount() {
        return this.disabledAccount;
    }

    @Override
    public boolean isExcessiveAttempts() {
        return this.excessiveAttempts;
    }
}
